<?php

$m = new Mongo();

$collection = $m->reader->bookshelf;

$cursor = $collection->find();

while($cursor->hasNext()) {
    //var_dump($cursor->getNext());

    $arr = $cursor->getNext();
    $id = $arr["_id"];
    $list = $arr["books"];
    if (count($list) <= 1)
        continue;
    echo $id.":";

    foreach( $list as $i)
        echo $i["id"].",";
    echo "\n";
}


?>
